<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue2</title>
</head>
<body>
  <script src="./vue.js"></script>

  <div id="one">
    <img src="./img/a.png" @mouseover="mouseOver"
      @mouseleave="mouseLeave" :style="{'opacity':opacity}">
  </div>

  <script>
    let vue=new Vue({
      el:"#one",
      data:{
        opacity:1
      },
      methods:{
        mouseOver(){
          this.opacity=0.5
        },
        mouseLeave(){
          this.opacity=1
        }
      }
    })
  </script>
</body>
</html>